home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / devel-docs / libgimp / sgml / gimpmath.sgml < prev    next >
Encoding:
Text File  |  2003-05-20  |  5.5 KB  |  214 lines

  1. <refentry id="libgimp-gimpmath" revision="19 Jan 2001">
  2. <refmeta>
  3. <refentrytitle>gimpmath</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. <refmiscinfo>LIBGIMP Library</refmiscinfo>
  6. </refmeta>
  7.  
  8. <refnamediv>
  9. <refname>gimpmath</refname><refpurpose>Mathematical definitions and macros.</refpurpose>
  10. </refnamediv>
  11.  
  12. <refsynopsisdiv><title>Synopsis</title>
  13. <synopsis>
  14.  
  15.  
  16.  
  17. #define     <link linkend="FINITE-CAPS">FINITE</link>                          (x)
  18. #define     <link linkend="G-PI-CAPS">G_PI</link>
  19. #define     <link linkend="G-PI-2-CAPS">G_PI_2</link>
  20. #define     <link linkend="G-PI-4-CAPS">G_PI_4</link>
  21. #define     <link linkend="G-SQRT2-CAPS">G_SQRT2</link>
  22. #define     <link linkend="G-MAXRAND-CAPS">G_MAXRAND</link>
  23. #define     <link linkend="RINT-CAPS">RINT</link>                            (x)
  24. #define     <link linkend="ROUND-CAPS">ROUND</link>                           (x)
  25. #define     <link linkend="SQR-CAPS">SQR</link>                             (x)
  26. #define     <link linkend="MAX255-CAPS">MAX255</link>                          (a)
  27. #define     <link linkend="CLAMP0255-CAPS">CLAMP0255</link>                       (a)
  28. #define     <link linkend="gimp-deg-to-rad">gimp_deg_to_rad</link>                 (angle)
  29. #define     <link linkend="gimp-rad-to-deg">gimp_rad_to_deg</link>                 (angle)
  30. </synopsis>
  31. </refsynopsisdiv>
  32.  
  33.  
  34.  
  35.  
  36.  
  37. <refsect1>
  38. <title>Description</title>
  39. <para>
  40. Mathematical definitions and macros.
  41.  
  42. </para>
  43. </refsect1>
  44.  
  45. <refsect1>
  46. <title>Details</title>
  47. <refsect2>
  48. <title><anchor id="FINITE-CAPS">FINITE()</title>
  49. <programlisting>#define     FINITE(x)</programlisting>
  50. <para>
  51.  
  52. </para><informaltable pgwide=1 frame="none" role="params">
  53. <tgroup cols="2">
  54. <colspec colwidth="2*">
  55. <colspec colwidth="8*">
  56. <tbody>
  57. <row><entry align="right"><parameter>x</parameter> :</entry>
  58. <entry>
  59.  
  60. </entry></row>
  61. </tbody></tgroup></informaltable></refsect2>
  62. <refsect2>
  63. <title><anchor id="G-PI-CAPS">G_PI</title>
  64. <programlisting>#define G_PI    3.14159265358979323846
  65. </programlisting>
  66. <para>
  67.  
  68. </para></refsect2>
  69. <refsect2>
  70. <title><anchor id="G-PI-2-CAPS">G_PI_2</title>
  71. <programlisting>#define G_PI_2  1.57079632679489661923
  72. </programlisting>
  73. <para>
  74.  
  75. </para></refsect2>
  76. <refsect2>
  77. <title><anchor id="G-PI-4-CAPS">G_PI_4</title>
  78. <programlisting>#define G_PI_4  0.78539816339744830962
  79. </programlisting>
  80. <para>
  81.  
  82. </para></refsect2>
  83. <refsect2>
  84. <title><anchor id="G-SQRT2-CAPS">G_SQRT2</title>
  85. <programlisting>#define G_SQRT2 1.4142135623730951
  86. </programlisting>
  87. <para>
  88.  
  89. </para></refsect2>
  90. <refsect2>
  91. <title><anchor id="G-MAXRAND-CAPS">G_MAXRAND</title>
  92. <programlisting>#define     G_MAXRAND</programlisting>
  93. <para>
  94.  
  95. </para></refsect2>
  96. <refsect2>
  97. <title><anchor id="RINT-CAPS">RINT()</title>
  98. <programlisting>#define     RINT(x)</programlisting>
  99. <para>
  100.  
  101. </para><informaltable pgwide=1 frame="none" role="params">
  102. <tgroup cols="2">
  103. <colspec colwidth="2*">
  104. <colspec colwidth="8*">
  105. <tbody>
  106. <row><entry align="right"><parameter>x</parameter> :</entry>
  107. <entry>
  108.  
  109. </entry></row>
  110. </tbody></tgroup></informaltable></refsect2>
  111. <refsect2>
  112. <title><anchor id="ROUND-CAPS">ROUND()</title>
  113. <programlisting>#define ROUND(x) ((int) ((x) + 0.5))
  114. </programlisting>
  115. <para>
  116.  
  117. </para><informaltable pgwide=1 frame="none" role="params">
  118. <tgroup cols="2">
  119. <colspec colwidth="2*">
  120. <colspec colwidth="8*">
  121. <tbody>
  122. <row><entry align="right"><parameter>x</parameter> :</entry>
  123. <entry>
  124.  
  125. </entry></row>
  126. </tbody></tgroup></informaltable></refsect2>
  127. <refsect2>
  128. <title><anchor id="SQR-CAPS">SQR()</title>
  129. <programlisting>#define SQR(x) ((x) * (x))
  130. </programlisting>
  131. <para>
  132.  
  133. </para><informaltable pgwide=1 frame="none" role="params">
  134. <tgroup cols="2">
  135. <colspec colwidth="2*">
  136. <colspec colwidth="8*">
  137. <tbody>
  138. <row><entry align="right"><parameter>x</parameter> :</entry>
  139. <entry>
  140.  
  141. </entry></row>
  142. </tbody></tgroup></informaltable></refsect2>
  143. <refsect2>
  144. <title><anchor id="MAX255-CAPS">MAX255()</title>
  145. <programlisting>#define MAX255(a)  ((a) | (((a) & 256) - (((a) & 256) >> 8)))
  146. </programlisting>
  147. <para>
  148.  
  149. </para><informaltable pgwide=1 frame="none" role="params">
  150. <tgroup cols="2">
  151. <colspec colwidth="2*">
  152. <colspec colwidth="8*">
  153. <tbody>
  154. <row><entry align="right"><parameter>a</parameter> :</entry>
  155. <entry>
  156.  
  157. </entry></row>
  158. </tbody></tgroup></informaltable></refsect2>
  159. <refsect2>
  160. <title><anchor id="CLAMP0255-CAPS">CLAMP0255()</title>
  161. <programlisting>#define CLAMP0255(a)  CLAMP(a,0,255)
  162. </programlisting>
  163. <para>
  164.  
  165. </para><informaltable pgwide=1 frame="none" role="params">
  166. <tgroup cols="2">
  167. <colspec colwidth="2*">
  168. <colspec colwidth="8*">
  169. <tbody>
  170. <row><entry align="right"><parameter>a</parameter> :</entry>
  171. <entry>
  172.  
  173. </entry></row>
  174. </tbody></tgroup></informaltable></refsect2>
  175. <refsect2>
  176. <title><anchor id="gimp-deg-to-rad">gimp_deg_to_rad()</title>
  177. <programlisting>#define gimp_deg_to_rad(angle) ((angle) * (2.0 * G_PI) / 360.0)
  178. </programlisting>
  179. <para>
  180.  
  181. </para><informaltable pgwide=1 frame="none" role="params">
  182. <tgroup cols="2">
  183. <colspec colwidth="2*">
  184. <colspec colwidth="8*">
  185. <tbody>
  186. <row><entry align="right"><parameter>angle</parameter> :</entry>
  187. <entry>
  188.  
  189. </entry></row>
  190. </tbody></tgroup></informaltable></refsect2>
  191. <refsect2>
  192. <title><anchor id="gimp-rad-to-deg">gimp_rad_to_deg()</title>
  193. <programlisting>#define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI))
  194. </programlisting>
  195. <para>
  196.  
  197. </para><informaltable pgwide=1 frame="none" role="params">
  198. <tgroup cols="2">
  199. <colspec colwidth="2*">
  200. <colspec colwidth="8*">
  201. <tbody>
  202. <row><entry align="right"><parameter>angle</parameter> :</entry>
  203. <entry>
  204.  
  205. </entry></row>
  206. </tbody></tgroup></informaltable></refsect2>
  207.  
  208. </refsect1>
  209.  
  210.  
  211.  
  212.  
  213. </refentry>
  214.